Skip to main content

Move

Moves the current sheet to another location in the workbook.

Syntax

expression.Move(before, after);

expression - A variable that represents a ApiWorksheet class.

Parameters

NameRequired/OptionalData typeDefaultDescription
beforeRequiredApiWorksheetThe sheet before which the current sheet will be placed. You cannot specify "before" if you specify "after".
afterRequiredApiWorksheetThe sheet after which the current sheet will be placed. You cannot specify "after" if you specify "before".

Returns

This method doesn't return any data.

Example

This example moves the sheet to another location in the workbook.

var oSheet1 = Api.GetActiveSheet();
Api.AddSheet("Sheet2");
var oSheet2 = Api.GetActiveSheet();
oSheet2.Move(oSheet1);